package au.com.mason.propertyTracker.util;

import org.springframework.beans.factory.BeanFactory;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class ApplicationContextUtils {

	public static final String[] CONTEXT_PATH = new String[] {"propertyTracker-daoContext.xml", "propertyTracker-serviceContext.xml"};
	
	public static Object getBean(String beanName) {
		ClassPathXmlApplicationContext appContext = new ClassPathXmlApplicationContext(CONTEXT_PATH);
		BeanFactory factory = (BeanFactory) appContext;
	
		return factory.getBean(beanName);
	}
}
